﻿@model CommerceOne.Models.ProductCommentViewModel


@if (Model != null)
{
    
    if (Model.PagingSortingViewModel != null)
    {
        var index = 1;
        <ul>
        @foreach(var item in Model.PagingSortingViewModel.PaginationList)
        {
            var style = string.Empty;
            <div
            @(item.IsCurrentSelected ? "style='background-color:black;color:white;'" : "")
            >
            
             @Ajax.ActionLink(item.LinkText, "Comments", new { productId = Model.ProductId, page = index },
            new AjaxOptions
            {
                UpdateTargetId = "tabledata",
                Url = Url.Action("Comments", new { productId = Model.ProductId, page = index }), 
                LoadingElementId = "loading",
                OnSuccess = "OnSuccess",
            })
            @*<a href="@item.LinkUrl">@item.LinkText</a> *@
            </div>
            index++;
        }
        </ul>
    }
     if (Model.Comments != null)
    {
        <ul>
        @foreach (var item in Model.Comments)
        {
            <li>@item.Content</li>
        }
        </ul>
    }
    
}
